﻿using nblTool.utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFirst.Entities;

namespace Jn698._45Tool.Service
{
    internal class DeviceService : IService<Device>
    {
        public int Delete(Device t)
        {
            return SqlSugarHelper.Db.Deleteable<Device>().Where(d=>d.DeviceAddress==t.DeviceAddress).ExecuteCommand();
        }

        public int DeleteAll()
        {
            return SqlSugarHelper.Db.Deleteable<Device>().ExecuteCommand();
        }

        public int Insert(Device t)
        {
            return SqlSugarHelper.Db.Insertable(t).ExecuteCommand();
        }

        public Device Select(int Id)
        {
            throw new NotImplementedException();
        }

        public Device Select(string Name)
        {
            throw new NotImplementedException();
        }

        public List<Device> Select()
        {
            return SqlSugarHelper.Db.Queryable<Device>().ToList();
        }

        public int Update(Device t)
        {
            throw new NotImplementedException();
        }
    }
}
